import 'package:json_annotation/json_annotation.dart';

part 'analysis_detail.g.dart';

@JsonSerializable()
class AnalysisDetail extends Object {

  @JsonKey(name: 'alreadyDisPriceCount')
  int alreadyDisPriceCount;

  @JsonKey(name: 'waitDistributeCount')
  int waitDistributeCount;

  @JsonKey(name: 'alreadyDisCount')
  int alreadyDisCount;

  @JsonKey(name: 'waitDistributePriceCount')
  int waitDistributePriceCount;

  @JsonKey(name: 'count')
  int count;

  @JsonKey(name: 'list')
  List<AnalysisDetailItem> list;

  @JsonKey(name: 'priceCount')
  int priceCount;

  AnalysisDetail();

  factory AnalysisDetail.fromJson(Map<String, dynamic> srcJson) => _$AnalysisDetailFromJson(srcJson);

  Map<String, dynamic> toJson() => _$AnalysisDetailToJson(this);

}

@JsonSerializable()
class AnalysisDetailItem extends Object {

  @JsonKey(name: 'money')
  int money;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'tableCount')
  int tableCount;

  @JsonKey(name: 'time')
  String time;

  @JsonKey(name: 'status')
  int status;

  String get statusText {
    var map = {
      0: '待分账',
      1: '已分账',
      2: '退单',
      3: '反结账',
    };

    return map[status];
  }

  AnalysisDetailItem(this.money,this.name,this.time,this.status,);

  factory AnalysisDetailItem.fromJson(Map<String, dynamic> srcJson) => _$AnalysisDetailItemFromJson(srcJson);

  Map<String, dynamic> toJson() => _$AnalysisDetailItemToJson(this);

}




  
